<template>
    <div class="container">
        <h1 class="title">{{ newList[$route.params.id - 1].title }}</h1>
        <p class="info">
            <span>发表时间: {{ newList[$route.params.id - 1].time | dateFormat('YYYY-MM-DD') }}</span>
            <span>点击: {{ newList[$route.params.id - 1].count}}次</span>
        </p>
        <hr>
        <div class="content">
            {{ newList[$route.params.id - 1].content}}
        </div>
        <comment-box :id="id"></comment-box>
    </div>
</template>

<script>
    import comment from "./comment.vue";
    export default {
        data(){
            return {
                id : 10,
                newList: [
                    {id: 1, url: '/images/1.jpg', title: '哈哈', time: new Date(), count: 1,content: '是否卡萨丁会发生角度看'},
                    {id: 2, url: '/images/2.jpg', title: '嘻嘻', time: new Date(), count: 2,content: '沙发上电风扇的风'},
                    {id: 3, url: '/images/3.jpg', title: '蹦蹦', time: new Date(), count: 3,content: '爱上打发打发地方'}
                ]
            }
        },
        components : {
            "comment-box": comment
        }
    }
</script>

<style scoped lang="less">
    .container{
        padding: 0 4px;
        .title{
            font-size: 16px;
            text-align: center;
            margin:15px 0;
            color: red;
        }
        .info{
            font-size:13px;
            color: #226aff;
            display: flex;
            justify-content: space-between;
        }
    }
</style>